package com.alamhubb.idea.plugin.simpleplugin;

import com.intellij.codeInsight.completion.CodeCompletionHandlerBase;
import com.intellij.codeInsight.completion.CompletionType;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;

public final class CompletionTrigger {
    public static void trigger(Project project, Editor editor) {
        System.out.println("Triggering completion");
        ApplicationManager.getApplication().invokeLater(() -> {
            System.out.println("Triggering completion123123");
            if (project.isDisposed() || editor.isDisposed()) return;
            new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(project, editor);
        });
    }
}